import request from '@/utils/request'

// 查询设备列表
export function listInstance(query) {
  return request({
    url: '/manage-api/device/instance/page',
    method: 'get',
    params: query
  })
}

// 查询设备详细
export function getInstance(id) {
  return request({
    url: '/manage-api/device/instance/get?id=' + id,
    method: 'get'
  })
}

// 新增设备
export function addInstance(data) {
  return request({
    url: '/manage-api/device/instance/create',
    method: 'post',
    data: data
  })
}

// 修改设备
export function updateInstance(data) {
  return request({
    url: '/manage-api/device/instance/update',
    method: 'put',
    data: data
  })
}

// 删除设备
export function delInstance(id) {
  return request({
    url: '/manage-api/device/instance/delete?id=' + id,
    method: 'delete'
  })
}
// 设备ota
export function otaInstance(data) {
    return request({
        url: '/manage-api/device/instance/ota',
        method: 'post',
        data: data
    })
}
// 设备实例-方法调用
export function invokeInstance(data) {
    return request({
        url: '/manage-api/device/instance/function-invoke',
        method: 'post',
        data: data
    })
}
